/***************************************************************************
 *   Copyright (C) 2008 by Tomasz Dubik                                    *
 *   tdubik@gmail.com                                                      *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef SHORTCUTCOLLECTION_H
#define SHORTCUTCOLLECTION_H
#include <QString>
#include <QMap>
class QAction ; 
/*! 
 * \class Shortcuts - small class for handling shorcuts ; 
 */
class Shortcuts
{
    public:
        /*!
         * \brief addShortcut - adds shortcut for given action 
         * \param _pAction - pointer to QAction where to add shortcut
         * \param _actionName - name of action ( the one we've given, this is not name given in QAction constructor ) 
         * \param _shortcut - shortcut, ie. Ctrl+k, Alt+Shift+Z
         * \remarks If. _shortcut is empty, then ask Settings for shortcut, if Settings don't have this, ask getDefault function. 
         *          If shortcut is still "", just return. 
         * \see getDefault
         * \see Settings::value() 
         */
        static void addShortcut ( QAction * _pAction, const QString & _actionName , const QString & _shortcut = "" ) ; 
        /*!
         * \brief saveShortcut - save shortcuts in settings 
         * \param _actionName - action name . 
         * \param _shrt - action shortcut . 
         */
        static void saveShortcut ( const QString & _actionName, const QString & _shrt ) ;
    private:
        /*!
         * \brief getDefault returns default shortcut for action. If not defindef retun ""
         * \param _actionName - action name 
         * \return QString - shortcut for action, if not defined returns ""
         */
        static QString getDefault( const QString & _actionName ) ; 
};
#endif // SHORTCUTCOLLECTION_H
